home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q1082.dms / q1082.adf / src.lzh / Fig / redisplay.c < prev    next >
C/C++ Source or Header  |  1991-07-18  |  2KB  |  103 lines

  1. /* 
  2.  *    FIG : Facility for Interactive Generation of figures
  3.  *
  4.  *    Copyright (c) 1988 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
  5.  *    Febuary 1988.
  6.  *
  7.  *    %W%    %G%
  8. */
  9. #include "fig.h"
  10. #include "resources.h"
  11. #include "object.h"
  12. #include "paintop.h"
  13.  
  14. extern int        pointmarker_shown;
  15. extern int        compoundbox_shown;
  16. extern int        foreground_color, background_color;
  17.  
  18. redisplay_objects(objects)
  19. F_compound    *objects;
  20. {
  21.     if (objects == NULL) return;
  22.     redisplay_textobject(objects->texts);
  23.     redisplay_lineobject(objects->lines);
  24.     redisplay_ellipseobject(objects->ellipses);
  25.     redisplay_arcobject(objects->arcs);
  26.     redisplay_splineobject(objects->splines);
  27.     redisplay_compoundobject(objects->compounds);
  28.     if (pointmarker_shown) toggle_pointmarker();
  29.     if (compoundbox_shown) {
  30.         F_compound    *c;
  31.         for (c = objects->compounds; c != NULL; c = c->next)
  32.         draw_compoundbox(c, INV_PAINT);
  33.         }
  34.     }
  35.  
  36. redisplay_arcobject(arcs)
  37. F_arc    *arcs;
  38. {
  39.     F_arc    *arc;
  40.  
  41.     for (arc = arcs; arc != NULL; arc = arc->next)
  42.         draw_arc(arc, foreground_color);
  43.     }
  44.  
  45. redisplay_ellipseobject(ellipses)
  46. F_ellipse    *ellipses;
  47. {
  48.     F_ellipse    *e;
  49.  
  50.     for (e = ellipses; e != NULL; e = e->next)
  51.         draw_ellipse(e, foreground_color);
  52.     }
  53.  
  54. redisplay_lineobject(lines)
  55. F_line    *lines;
  56. {
  57.     F_line    *line;
  58.  
  59.     for (line = lines; line != NULL; line = line->next) 
  60.         draw_line(line, PAINT);
  61.     }
  62.  
  63. redisplay_splineobject(splines)
  64. F_spline    *splines;
  65. {
  66.     F_spline    *s;
  67.  
  68.     for (s = splines; s != NULL; s = s->next)
  69.         draw_spline(s, PAINT);
  70.     }
  71.  
  72. redisplay_textobject(texts)
  73. F_text    *texts;
  74. {
  75.     F_text    *t;
  76.  
  77.     for (t = texts; t != NULL; t = t->next)
  78.         draw_text(t, PAINT);
  79.     }
  80.  
  81. redisplay_compoundobject(compounds)
  82. F_compound    *compounds;
  83. {
  84.     F_compound    *c;
  85.  
  86.     for (c = compounds; c != NULL; c = c->next) {
  87.         draw_compound(c);
  88.         }
  89.     }
  90.  
  91. redisplay_canvas()
  92. {
  93.     extern F_compound    objects;
  94.  
  95.     clear_canvas();
  96.     set_temp_cursor(&wait_cursor);
  97.     pw_batch_on(canvas_pixwin);
  98.     redisplay_objects(&objects);
  99.     redisplay_grid();
  100.     pw_batch_off(canvas_pixwin);
  101.     reset_cursor();
  102.     }
  103.